<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
<script language="javascript" src="../myClass/MyClass.js"></script>
<script language="javascript" src="Odometro.js"></script>
</head>

<body>

<div id="tablero_content" style="width:100%; text-align:center; overflow:hidden"> 
   <table align="center" width="600" cellspacing="0" cellpadding="0"="" border="1px">
      <tr>
      	<td width="185" height="160"></td>
        <td width="185" height="150" bgcolor="#000000" id="posOdometro" align="center"></td>
        <td width="185"></td>
      </tr>	
      <tr>
      	<td></td>
        <td><input name="" value="cambiar" type="button" onclick="change();" /></td>
        <td id='kilometros'>kilometros: 0 km</td>
      </tr>	
   </table>
</div>

<script type="text/javascript">
	var odometro = new Odometro({digits:6, imagesURL:'images/'});
	odometro.putDisplayIn('posOdometro');
	
	function aleatorio(inferior,superior){ 
   		numPosibilidades = superior - inferior; 
    	aleat = Math.random() * numPosibilidades; 
	    aleat = Math.floor(aleat); 
    	return parseInt(inferior) + aleat; 
	} 
	
	function change(){
		var kilometros = aleatorio(0,999999);
		document.getElementById('kilometros').innerHTML = 'kilometros: '+kilometros+' km.';
		odometro.setValue(kilometros);
	}
			
</script>

</body>
</html>
